/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package CCPVSimulationPackage;

import GISPackage.Region;
import GISPackage.Regions;
import java.io.File;
import java.io.IOException;
import java.util.Vector;

/**
 *
 * @author Heather
 */
public class CCPVSimulation
{
  // for now, store the iterations as a straight array... may need to change to a hashmap...

  private Vector<CCPVSimulationIteration> allIterations = new Vector<CCPVSimulationIteration>();
  private int index = -1;

  public CCPVSimulation()
  {
    index = -1;
  }

  public void addCCPVSimulationIteration(CCPVSimulationIteration newIteration)
  {
    allIterations.add(newIteration);
  }

  public CCPVSimulation(String filename, Region r)
  {
    CCPVSimulationIteration si = new CCPVSimulationIteration(filename, r);
    allIterations.add(si);
  }

  public CCPVSimulationIteration getNextIteration()
  {
    if (allIterations.size() > 0)
    {
      index++;
      if (index > allIterations.size() - 1)
      {
        index = allIterations.size() - 1;
      }
      return allIterations.get(index);
    }
    else
    {
      return null;
    }
  }

  public CCPVSimulationIteration getPreviousIteration()
  {
    if (allIterations.size() > 0)
    {
      index--;
      if (index < 0)
      {
        index = 0;
      }
      return allIterations.get(index);
    }
    else
    {
      return null;
    }
  }

  public void addDefaultCCPVSimulationIteration()
  {
    CCPVSimulationIteration si = new CCPVSimulationIteration();
    allIterations.add(si);
  }
}
